package y2017.m10.d12;

import java.net.InetAddress;

public class Host {
    public static void main(String[] args) throws Exception {
        InetAddress address = InetAddress.getByName("localhost");
        String hostName = address.getHostName();
        String hostAddress = address.getHostAddress();
//        localhost
        System.out.println(hostName);
//        127.0.0.1
        System.out.println(hostAddress);
    }
}
